import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '订单ID',
    align:"center",
    dataIndex: 'orderId'
   },
   {
    title: '商品ID',
    align:"center",
    dataIndex: 'goodsId'
   },
   {
    title: '商品名称',
    align:"center",
    dataIndex: 'goodsName'
   },
   {
    title: '商品规格',
    align:"center",
    dataIndex: 'goodsSpec'
   },
   {
    title: '商品价格',
    align:"center",
    dataIndex: 'goodsPrice'
   },
   {
    title: '购买数量',
    align:"center",
    dataIndex: 'goodsNum'
   },
   {
    title: '商品总价',
    align:"center",
    dataIndex: 'goodsTotal'
   },
   {
    title: '商品运费',
    align:"center",
    dataIndex: 'goodsFreight'
   },
   {
    title: '商品主图',
    align:"center",
    dataIndex: 'goodsImg',
    customRender:render.renderImage,
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remarks'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '订单ID',
    field: 'orderId',
    component: 'Input',
  },
  {
    label: '商品ID',
    field: 'goodsId',
    component: 'Input',
  },
  {
    label: '商品名称',
    field: 'goodsName',
    component: 'Input',
  },
  {
    label: '商品规格',
    field: 'goodsSpec',
    component: 'Input',
  },
  {
    label: '商品价格',
    field: 'goodsPrice',
    component: 'InputNumber',
  },
  {
    label: '购买数量',
    field: 'goodsNum',
    component: 'InputNumber',
  },
  {
    label: '商品总价',
    field: 'goodsTotal',
    component: 'InputNumber',
  },
  {
    label: '商品运费',
    field: 'goodsFreight',
    component: 'InputNumber',
  },
  {
    label: '商品主图',
    field: 'goodsImg',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '备注',
    field: 'remarks',
    component: 'InputTextArea',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}